﻿<UserControl x:Class="LiveEduWizard.AgendaItem"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:LiveEduWizard"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="70" d:DesignWidth="432" SizeChanged="UserControl_SizeChanged">

    <UserControl.Resources>
        <local:DateConverter x:Key="dateConverter"/>
    </UserControl.Resources>

    <StackPanel x:Name="LayoutRoot" Margin="0,0,0,17" Width="432">
        <TextBlock Text="{Binding Date, Converter={StaticResource dateConverter}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextGroupHeaderStyle}"/>
        <ListBox x:Name="AppointmentsListBox" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Tap="Appointment_Tap">
                        <Grid Width="432">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="30"/>
                            </Grid.ColumnDefinitions>
                            <StackPanel Orientation="Horizontal" Grid.Column="0">
                                <TextBlock Text="{Binding AgendaTime}" TextWrapping="Wrap" Style="{StaticResource PhoneTextLargeStyle}"/>
                                <TextBlock Text="{Binding Subject}" Margin="0,0,0,0" TextWrapping="Wrap" Style="{StaticResource PhoneTextLargeStyle}"/>
                            </StackPanel>
                            <Image Grid.Column="1"/>
                        </Grid>
                        <TextBlock Text="{Binding Title}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextTitle3Style}"/>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </StackPanel>
</UserControl>
